<template>
  <!--ASN明细-->
  <div id="AsnDetails">
    <v-details
      :detailData="data.detailData"
      :inputConfig="inputConfig"
      :rules="rules"
    ></v-details>
  </div>
</template>

<script>
import details from "commons/Detail";
import baseMixin from "@/mixins/BaseMixin";

export default {
  name: "",
  mixins: [baseMixin],
  props: {
    data: {
      type: Object,
    },
  },
  data() {
    return {
      rules: {},
    };
  },
  computed: {
    inputConfig() {
      if (this.data.type == "activity_filter") {
        return [
          [
            {
              type: "select",
              label: this.$t('bill.fieldName'),
              props: "field_name",
              options: this.getOptions(
                `/queryFieldNameDrowDown/${this.data.argument.activity_id}/${this.data.argument.facility_id}`
              ),
              disabled: false,
            },
            {
              type: "select",
              label: this.$t('bill.operatorName'),
              props: "operator",
              options: this.getOptions("/codeLookup/OPERATOR"),
              disabled: false,
            },
            {
              type: "input",
              label: this.$t('bill.firstValue'),
              props: "first_value",
              disabled: false,
            },
            {
              type: "input",
              label: this.$t('bill.secondValue'),
              props: "second_value",
              disabled: false,
            },
            {
              type: "select",
              label: this.$t('bill.filterConnector'),
              props: "filter_connector",
              options: this.getOptions("/codeLookup/ANDOR"),
              disabled: false,
            },
          ],
        ];
      } else if (this.data.type == "activity_trans") {
        return [
          [
            {
              type: "input",
              label: this.$t('bill.activityClass'),
              props: "activity_class",
              disabled: false,
            },
            {
              type: "input",
              label: this.$t('bill.activityObject'),
              props: "activity_object",
              disabled: false,
            },
            {
              type: "input",
              label: this.$t('bill.activityAction'),
              props: "activity_action",
              disabled: false,
            },
            {
              type: "input",
              label: this.$t('bill.activityType'),
              props: "activity_type",
              disabled: false,
            },
          ],
        ];
      }
      return []
    },
  },
  methods: {},
  mounted() {},
  watch: {},
  components: {
    "v-details": details,
  },
};
</script>

<style scoped></style>
